* Barry Edwards
* Replication File for "Formulating Voting Rights Act Remedies to Address Current Conditions"
use "edwardsDataVotingRights.dta"


* Code below produces contents of Table 1 in article as well as the tables (earlier elections) in the online appendix
* Af Am Probabilities

logit afAmVoterSuccess  blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear >= 2002, robust
*** postestimation Correctly Predicted and PRE
predict predictAfAmFrom2000s, p
replace   predictAfAmFrom2000s = 0 if  predictAfAmFrom2000s < .5  
replace   predictAfAmFrom2000s = 1 if  predictAfAmFrom2000s >= .5  
table  afAmVoterSuccess predictAfAmFrom2000s  if electionYear >= 2002  

logit afAmVoterSuccess  blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear <= 2000 & electionYear >= 1992, robust
*** postestimation Correctly Predicted and PRE
predict predictAfAmFrom1990s, p
replace   predictAfAmFrom1990s = 0 if  predictAfAmFrom1990s < .5  
replace   predictAfAmFrom1990s = 1 if  predictAfAmFrom1990s >= .5  
table  afAmVoterSuccess predictAfAmFrom1990s  if electionYear <= 2000 & electionYear >= 1992

logit afAmVoterSuccess  blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear <= 1990 & electionYear >= 1982, robust
*** postestimation Correctly Predicted and PRE
predict predictAfAmFrom1980s, p
replace   predictAfAmFrom1980s = 0 if  predictAfAmFrom1980s < .5  
replace   predictAfAmFrom1980s = 1 if  predictAfAmFrom1980s >= .5  
table  afAmVoterSuccess predictAfAmFrom1980s  if electionYear <= 1990 & electionYear >= 1982

logit afAmVoterSuccess  blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear <= 1980 & electionYear >= 1972, robust
*** postestimation Correctly Predicted and PRE
predict predictAfAmFrom1970s, p
replace   predictAfAmFrom1970s = 0 if  predictAfAmFrom1970s < .5  
replace   predictAfAmFrom1970s = 1 if  predictAfAmFrom1970s >= .5  
table  afAmVoterSuccess predictAfAmFrom1980s  if electionYear <= 1980 & electionYear >= 1972

logit afAmVoterSuccess  blackVAP    whiteIncumbent openSeat if electionYear <= 1970 & electionYear >= 1962, robust
*** postestimation Correctly Predicted and PRE
predict   predictAfAmFrom1960s, p
replace   predictAfAmFrom1960s = 0 if  predictAfAmFrom1960s < .5  
replace   predictAfAmFrom1960s = 1 if  predictAfAmFrom1960s >= .5  
table  afAmVoterSuccess predictAfAmFrom1960s  if electionYear <= 1970 & electionYear >= 1962 & blackVAP != .




************************** Latino probabilities

logit latinoVoterSuccess  latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear >= 2002, robust
*** postestimation Correctly Predicted and PRE
predict   predictLatinoFrom2000s, p
replace   predictLatinoFrom2000s = 0 if  predictLatinoFrom2000s < .5  
replace   predictLatinoFrom2000s = 1 if  predictLatinoFrom2000s >= .5  
table  latinoVoterSuccess predictLatinoFrom2000s  if electionYear >= 2002  

logit latinoVoterSuccess latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear <= 2000 & electionYear >= 1992, robust
*** postestimation Correctly Predicted and PRE
predict   predictLatinoFrom1990s, p
replace   predictLatinoFrom1990s = 0 if  predictLatinoFrom1990s < .5  
replace   predictLatinoFrom1990s = 1 if  predictLatinoFrom1990s >= .5  
table  latinoVoterSuccess predictLatinoFrom1990s  if electionYear <= 2000 & electionYear >= 1992

logit latinoVoterSuccess latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear <= 1990 & electionYear >= 1982, robust
*** postestimation Correctly Predicted and PRE
predict   predictLatinoFrom1980s, p
replace   predictLatinoFrom1980s = 0 if  predictLatinoFrom1980s < .5  
replace   predictLatinoFrom1980s = 1 if  predictLatinoFrom1980s >= .5  
table  latinoVoterSuccess predictLatinoFrom1980s  if electionYear <= 1990 & electionYear >= 1982

logit latinoVoterSuccess latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear <= 1980 & electionYear >= 1972, robust
*** postestimation Correctly Predicted and PRE
predict   predictLatinoFrom1970s, p
replace   predictLatinoFrom1970s = 0 if  predictLatinoFrom1970s < .5  
replace   predictLatinoFrom1970s = 1 if  predictLatinoFrom1970s >= .5  
table  latinoVoterSuccess predictLatinoFrom1970s  if electionYear <= 1980 & electionYear >= 1972

* logit latinoVoterSuccess  blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear <= 1970 & electionYear >= 1962, robust
* this last one can't be done bcs Census did not measure



**************** the code below produces the statistics in the text in the limitations and discussion section

*  Af Am Republicans issue
logit  AfAmSuccessWithRepub blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear >= 2002, robust
logit  AfAmSuccessWithRepub blackVAP latinoVAPsmooth   whiteIncumbent openSeat if electionYear >= 2002 [pweight = sampleWeight], robust

* Latino Republicans
logit LatinoSuccessWithRepub  latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear >= 2002, robust
logit LatinoSuccessWithRepub  latinoVAPsmooth blackVAP    whiteIncumbent openSeat if electionYear >= 2002 [pweight = sampleWeight], robust

* how do predictions hold up over time?

table  afAmVoterSuccess predictAfAmFrom1970s  if electionYear <= 1990 & electionYear >= 1982
table  latinoVoterSuccess predictLatinoFrom1970s if electionYear <= 1990 & electionYear >= 1982

table  afAmVoterSuccess predictAfAmFrom1980s  if electionYear <= 2000 & electionYear >= 1992
table  latinoVoterSuccess predictLatinoFrom1980s if electionYear <= 2000 & electionYear >= 1992

table  afAmVoterSuccess predictAfAmFrom1990s  if electionYear <= 2010 & electionYear >= 2002
table  latinoVoterSuccess predictLatinoFrom1990s if electionYear <= 2010 & electionYear >= 2002




